package alkaid.oss.common.util;

/**
 * 接口请求错误响应
 * 
 * @author Lucky Yang
 * @since 0.0.1
 */
public class ErrorResponse {
    public final String error;
    public final String clazz;
    public final int status;

    private ErrorResponse(String error, String clazz, int status) {
        this.error = error;
        this.clazz = clazz;
        this.status = status;
    }

    public static ErrorResponse of(Throwable t, int status) {
        return new ErrorResponse(t.getMessage(), t.getClass().getName(), status);
    }
}
